<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>LABTEC - Buscar Orden de Trabajo</title>
	
		<script type="text/javascript">

		function serchOrden(){
			var idLabArray = document.forms[0].idLabDep.value.split("-");
			document.forms[0].laboratorioBus.value = idLabArray[0];
			document.forms[0].departamentoBus.value = idLabArray[1];
			document.forms[0].submit();
		}
	</script>
</head>

<body>
	<div id="header">
    	<jsp:include page="../jsp/menuIniciador.jsp" />
	</div>
	<div class="sheet">
		<div class="sheet-tl"></div>
		<div class="sheet-tr"></div>
		<div class="sheet-bl"></div>
		<div class="sheet-br"></div>
		<div class="sheet-tc"></div>
		<div class="sheet-bc"></div>
		<div class="sheet-cl"></div>
		<div class="sheet-cr"></div>
		<div class="sheet-cc"></div>
		<div class="sheet-body">
			<s:form action="buscarOrdenTrabajoAction" theme="simple">
				<table width="100%" border="0">
					<tr>
						<td colspan="4" class="postmetadataheader">
							<h2 class="postheader">
								Busqueda de Ordenes de Trabajo
							</h2>
						</td>
					</tr>
					
					<tr>
						<td width="20%">
							Numero de Orden
						</td>
						<td width="30%">
							<s:textfield name="idOrdenBus"></s:textfield>
							<s:hidden name="idOrden"></s:hidden>
						</td>
						<td width="20%">
							Año de la Orden
						</td>
						<td width="30%">
							<s:textfield name="anioOrdenBus"></s:textfield>
							<s:hidden name="anioOrden"></s:hidden>
						</td>
					</tr>
										
					<tr>
						<td width="20%">
							Laboratorio
						</td>
						<td width="30%">
							<s:select name="idLabDep" listKey="idLaboratorio" listValue="nombreLab" list="listaLab"/>
							<s:hidden name="laboratorioBus"></s:hidden>
							<s:hidden name="departamentoBus"></s:hidden>
							<s:hidden name="laboratorio"></s:hidden>
							<s:hidden name="departamento"></s:hidden>
						</td>
						<td width="20%">
							Aceptación del Contrato
						</td>
						<td width="30%">
							<s:radio name="estado" list="#{'H':'Habilitada','I':'Inhabilitada','':'Todas'}" />
						</td>
					</tr>
					
					<tr>
						<td width="20%">
							Razón Social
						</td>
						<td width="30%">
							<s:textfield name="razonSocial"></s:textfield>
						</td>
						<td width="20%">
							CUIT
						</td>
						<td width="30%">
							<s:textfield name="cuit"></s:textfield>
						</td>
					</tr>
					
					<tr>
						<td width="20%">
							Rubro
						</td>
						<td width="30%">
							<s:textfield name="rubro"></s:textfield>
						</td>
						<td width="20%">
							Responsable
						</td>
						<td width="30%">
							<s:textfield name="responsable"></s:textfield>
						</td>
					</tr>							

				</table>
				
				<table width="100%" border="0">
					<tr height="50px">
						<td  align="right">
							<input type="button" value="Buscar" name="buscar" onclick="serchOrden();"/>
						</td>
					</tr>
				</table>
			</s:form>
			
			<s:if test="%{!resultList.isEmpty()}">
				<jsp:include page="../jsp/ordenDeTrabajo-resultado.jsp"></jsp:include>
			</s:if>
		</div>

	</div>
</body>
</html>